$(document).ready(function () {
	$('#dqzlBank li').click(function(){
		var $div = $("#dqzlBankDiv").find("div.dqzlBankDiv-show");
		$(this).addClass('active');
		$(this).siblings().removeClass('active')
		var index = $(this).index();
		$div.siblings().hide();
		$div.eq(index).show();
	});
    
	
});

/* 征信查询 */
function getJkZxcx(url){
	$.dpAjax({
		show:false,
		url:url,
		data:{queryCreditApplyId:$("#queryCreditApplyId").val()},
		success: function(datas){
			 var data = datas.result;
			 if(data){
 				 //征信信息
 				 var cusNo = data.cusNo;
 				 var cusNoPeiOu = data.cusNoPeiOu;
 				 var cusNoDanBaoRen1 = data.cusNoDanBaoRen1;
 				 var cusNoDanBaoRen2 = data.cusNoDanBaoRen2;
 				 var cusNoDanBaoRen3 = data.cusNoDanBaoRen3;
 				 var cusNoDanBaoRen4 = data.cusNoDanBaoRen4;
 				 clearAllJk();
 				 var zxCreditQuerys = data.zxCreditQuerys;
 				 if(zxCreditQuerys && zxCreditQuerys.length > 0) {
     				 for(var i in zxCreditQuerys) {
	     				showZxJk(zxCreditQuerys[i], cusNo, cusNoPeiOu, cusNoDanBaoRen1, cusNoDanBaoRen2, cusNoDanBaoRen3, cusNoDanBaoRen4);
     				 }
 				 }
			 }
         }
	});
}

//展示征信信息
function showZxJk(zxCreditQuery, cusNo, cusNoPeiOu, cusNoDanBaoRen1, cusNoDanBaoRen2, cusNoDanBaoRen3, cusNoDanBaoRen4){
	var target = '';
	if(zxCreditQuery.cusNo == cusNo) {
		target = 'zjr';
	} else if(zxCreditQuery.cusNo == cusNoPeiOu) {
		target = 'peiou';
	} else if(zxCreditQuery.cusNo == cusNoDanBaoRen1) {
		target = 'dbr1';
	} else if(zxCreditQuery.cusNo == cusNoDanBaoRen2) {
		target = 'dbr2';
	} else if(zxCreditQuery.cusNo == cusNoDanBaoRen3) {
		target = 'dbr3';
	} else if(zxCreditQuery.cusNo == cusNoDanBaoRen4) {
		target = 'dbr4';
	}
	showZxJkData(target, zxCreditQuery);
}

function showZxJkData(target, zxCreditQuery) {
	if(zxCreditQuery) {
		$('#'+target+'_zxCreditQueryId').val(zxCreditQuery.replaceId);
		$('#'+target+'_cusName').html(zxCreditQuery.cusName);
		$('#'+target+'_cusNo').html(zxCreditQuery.cusNo);
		$('#'+target+'_operatorDate').html(formateIntegerMinutes(zxCreditQuery.modified));
		$('#'+target+'_creditResult').html(zxCreditQuery.creditResultDisplay);
		$('#'+target+'_wjqdkbsDy').html(zxCreditQuery.wjqdkbsDy);
		$('#'+target+'_wjqdkyeDy').html(zxCreditQuery.wjqdkyeDy);
		$('#'+target+'_jlnyqcsDy').html(zxCreditQuery.jlnyqcsDy);
		$('#'+target+'_dyzgyqjeDy').html(showNumber(zxCreditQuery.dyzgyqjeDy));
		$('#'+target+'_dyyqjeDy').html(showNumber(zxCreditQuery.dyyqjeDy));
		$('#'+target+'_jlgypjyhDy').html(showNumber(zxCreditQuery.jlgypjyhDy));
		$('#'+target+'_wjqdkbsXy').html(zxCreditQuery.wjqdkbsXy);
		$('#'+target+'_wjqdkyeXy').html(showNumber(zxCreditQuery.wjqdkyeXy));
		$('#'+target+'_jlnyqcsXy').html(zxCreditQuery.jlnyqcsXy);
		$('#'+target+'_dyzgyqjeXy').html(showNumber(zxCreditQuery.dyzgyqjeXy));
		$('#'+target+'_dyyqjeXy').html(showNumber(zxCreditQuery.dyyqjeXy));
		$('#'+target+'_jlgypjyhXy').html(showNumber(zxCreditQuery.jlgypjyhXy));
		$('#'+target+'_zsXyk').html(zxCreditQuery.zsXyk);
		$('#'+target+'_sxzeXyk').html(showNumber(zxCreditQuery.sxzeXyk));
		$('#'+target+'_jlnyqcsXyk').html(zxCreditQuery.jlnyqcsXyk);
		$('#'+target+'_jlgysyeXyk').html(showNumber(zxCreditQuery.jlgysyeXyk));
		$('#'+target+'_dqyqjeXyk').html(showNumber(zxCreditQuery.dqyqjeXyk));
		$('#'+target+'_dyzgyqjeXyk').html(showNumber(zxCreditQuery.dyzgyqjeXyk));
		$('#'+target+'_bsDwdb').html(zxCreditQuery.bsDwdb);
		$('#'+target+'_yeDwdb').html(showNumber(zxCreditQuery.yeDwdb));
		$('#'+target+'_fdyeBz').html(showNumber(zxCreditQuery.fdyeBz));
		$('#'+target+'_creditResultMark').html(zxCreditQuery.creditResultMark);
		
		$('#'+target+'_label').show();
		//$('#'+target+'_div').show();
	}
}
function clearAllJk(){
	clear_Jkzx('zjr');
	clear_Jkzx('peiou');
	clear_Jkzx('dbr1');
	clear_Jkzx('dbr2');
	clear_Jkzx('dbr3');
	clear_Jkzx('dbr4');
}
function clear_Jkzx(target){
	$('#'+target+'_label').hide();
	$('#'+target+'_div').hide();
	$('#'+target+'_zxCreditQueryId').val('');
	$('#'+target+'_cusName').html('');
	$('#'+target+'_cusNo').html('');
	$('#'+target+'_operatorDate').html('');
	$('#'+target+'_bankCode').html('');
	$('#'+target+'_loanCrdt').html('');
	$('#'+target+'_cardCrdt').html('');
	$('#'+target+'_leftNum').html('');
	$('#'+target+'_leftAmount').html('');
	$('#'+target+'_creditResult').html('');
	$('#'+target+'_onceCarStatus').html('');
}

